import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
public class RegisterWindow {
    public static void open(Display display) {
        Shell shell = new Shell(display);
        shell.setText("注册新用户");
        shell.setSize(300, 200);
        shell.setLayout(null);

        Label userLabel = new Label(shell, SWT.NONE);
        userLabel.setText("用户名:");
        userLabel.setBounds(30, 30, 60, 20);

        Text username = new Text(shell, SWT.BORDER);
        username.setBounds(100, 30, 150, 20);

        Label passLabel = new Label(shell, SWT.NONE);
        passLabel.setText("密码:");
        passLabel.setBounds(30, 70, 60, 20);

        Text password = new Text(shell, SWT.BORDER | SWT.PASSWORD);
        password.setBounds(100, 70, 150, 20);
        Button registerBtn = new Button(shell, SWT.PUSH);
        registerBtn.setText("注册");
        registerBtn.setBounds(100, 120, 60, 30);
        registerBtn.addListener(SWT.Selection, e -> {
            MessageBox box = new MessageBox(shell, SWT.ICON_INFORMATION);
            box.open();
        });
        shell.open();
    }
}

